Release 10.1A: OpenEdge Development:
ProDataSets
Using Data-Source attributes and methods
You can identify the
DATA-SOURCEcurrently attached to a buffer using this attribute:
The
GET-DATASET-BUFFERattribute on the Data-Source handle returns the buffer handle for the Data-Source’s associated ProDataSet buffer:
The
DATA-SOURCE-COMPLETE-MAPattribute returns a comma-separated list of field name pairs for all fields in a ProDataSet temp-table buffer that are mapped to corresponding fields in an attached Data-source object. This list is formatted as a comma-separated list of field name pairs, qualified with the ProDataSet and Data-Source temp-table names, using the following syntax:
If the ProDataSet temp-table buffer does not have an attached Data-source object, this attributes returns the Unknown value (
?).You can get the source buffers from a data-source with the
NUM-SOURCE-BUFFERSattribute and theGET-SOURCE-BUFFERmethod, as shown:
Because a Data-Source most often has only one source buffer, the buffer-index argument is optional and defaults to 1.
You can get a comma-separated list of key fields defined in an associated
KEYSclause for the specified buffer by using theKEYSattribute, as shown:
If there are no defined key fields, this attribute returns a comma-separated list of key fields in the buffer’s unique primary index (if any). If there are no defined key fields and no unique primary index, this attribute returns the string
"ROWID”.You can retrieve the
ROWIDof the data source row at which the nextFILLoperation should start with theNEXT-ROWIDattribute, as shown:
Progress sets this attribute after each
Note: This attribute is not marshalled between the client and the AppServer. You are responsible for retrieving, storing, and transporting this attribute value between the client and the AppServer.FILLoperation in a series ofFILLoperations to retrieve data source rows in batches. You typically assign the value of this attribute to theRESTART-ROWIDattribute before eachFILLoperation.You can retrieve the
ROWIDof the data source row at which aFILLoperation will start with theRESTART-ROWIDattribute. Set this attribute before eachFILLoperation in a series ofFILLoperations to retrieve data source rows in batches. For example
You can retrieve the current where-clause for a buffer’s query, whether it has been set explicitly or derived automatically from the fields in its relation, using the read-only
FILL-WHERE-STRINGattribute, as shown:
You cannot set this attribute, but you might want to use the string to help you construct a query of your own to retrieve records that perhaps require more filtering than the relation provides by default.
As with other objects, you can get a handle to a static Data-Source. Precede the Data-Source name with the keyword
DATA-SOURCE, as shown:
This block of code added to
DynamicDataSet2.pretrieves the Data-Source for each of the ProDataSet’s buffers and displays its database source buffer’s name and thewhere-clausethat Progress generates automatically for the table based on the relation:
The output for these
MESSAGEstatements follow:
![]()
The first database table for the ProDataSet is the
Customertable. There’s no default where-clause for it because it’s the top-level table and has no parent. Even though you have defined a where-clause for this top-level table in theDynamicDataSetprocedure, that’s not assigned to theFILL-WHERE-STRINGattribute. This attribute shows only the default selection Progress generates for you:
![]()
The second Data-Source is the
Ordertable. It does have aFILL-WHERE-STRINGbecause it is the child of a relation. If you compare itsFILL-WHERE-STRINGattribute with theWHERE-STRINGof its Data-Relation, you can see the difference between the job the Data-Source has to do during aFILLand the job the relation does after theFILLis complete and you’re navigating the ProDataSet.This
FILL-WHERE-STRINGretrievesOrderrecords from theOrderdatabase table by matching theCustNumof thettCustomertemp-table record that has just been retrieved from the databaseCustomertable and created in the ProDataSet’s temp-table.The relation’s
WHERE-STRINGcompares thettCustomertemp-table with the records already in thettOrdertemp-table, because it’s used to navigate the filled ProDataSet:
![]()
Finally, you see the Data-Source for the
SalesReptable. It also has noFILL-WHERE-STRINGbecause it is not involved in a relation at all.Standard object attributes that are valid for the Data-Source and accessible through its handle include:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |